<template>
  <div class="app-container">
    <div class="item2">
      <div class="header">
        <div class="title1">
          <i class="el-icon-data-analysis"></i><span>出库复核记录查询</span>
        </div>
        <!-- <div class="backB">
          <img src="@/assets/images/back.png" alt="" @click="goBack" />
        </div> -->
      </div>
      <div class="formCenter">
        <el-form
          :model="queryParams"
          size="large"
          :inline="true"
          ref="queryForm"
          label-width="100px"
        >
        <el-form-item label="货主编号:" prop="fmcustomerId">
            <el-input
              v-model="queryParams.fmcustomerId"
              placeholder="请输入货主编号"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="订单号:" prop="docNo">
            <el-input
              v-model="queryParams.docNo"
              placeholder="请输入订单号"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="商品编码:" prop="sku">
            <el-input
              v-model="queryParams.sku"
              placeholder="请输入商品编码"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="批号:" prop="lotatt04">
            <el-input
              v-model="queryParams.lotatt04"
              placeholder="请输入批号"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="下单方:" prop="issuepartyId">
            <el-input
              v-model="queryParams.issuepartyId"
              placeholder="请输入下单方"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="时间:">
            <el-date-picker
              v-model="redateRange"
              style="width: 240px"
              value-format="yyyy-MM-dd"
              type="daterange"
              range-separator="-"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
            ></el-date-picker>
          </el-form-item>
          <el-form-item>
            <div class="btn">
              <el-button
                type="primary"
                icon="el-icon-search"
                size="medium"
                @click="handleQuery"
                >搜索</el-button
              >
              <el-button
                type="primary"
                icon="el-icon-refresh"
                size="medium"
                @click="resetQuery"
                >重置</el-button
              >
            </div>
          </el-form-item>
        </el-form>
      </div>
      <el-table
        :data="tableData"
        border
        height="680"
        v-loading="loading"
        element-loading-text="拼命加载中"
        element-loading-spinner="el-icon-loading"
        :header-cell-style="{ background: '#1890ff', color: '#ffffff' }"
      >
        <!-- <el-table-column align="center" prop="floor" label="楼层">
        </el-table-column> -->
        <el-table-column align="center" prop="fmcustomerId" label="货主编号">
        </el-table-column>
        <el-table-column
          align="center"
          prop="hzmc"
          label="货主名称"
          width="200"
        >
        </el-table-column>
        <el-table-column align="center" prop="issuepartyId" label="下单方">
        </el-table-column>
        <el-table-column align="center" prop="rq" label="出库日期" width="110">
        </el-table-column>
        <el-table-column
          align="center"
          prop="codeDescr"
          label="业务类型"
          width="130"
        >
        </el-table-column>
        <el-table-column align="center" prop="docNo" label="订单号" width="150">
        </el-table-column>
        <el-table-column
          align="center"
          prop="dwbh"
          label="单位编号"
          width="200"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="dwmc"
          label="单位名称"
          width="200"
        >
        </el-table-column>
        <el-table-column align="center" prop="sku" label="商品编号" width="180">
        </el-table-column>
        <el-table-column
          align="center"
          prop="skuDescr1"
          label="通用名称"
          width="180"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="alternateSku3"
          label="规格/型号、规格"
          width="120"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="alternateSku4"
          label="生产厂家/受托生产企业名称"
          width="150"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="alternateSku5"
          label="产地"
          width="130"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="cctj"
          label="贮存条件"
          width="100"
        >
        </el-table-column>
        <el-table-column align="center" prop="jx" label="剂型" width="100">
        </el-table-column>
        <el-table-column
          align="center"
          prop="zlzk"
          label="质量状况"
          width="120"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="lotatt04"
          label="生产批号/序列号"
          width="120"
        >
        </el-table-column>

        <el-table-column
          align="center"
          prop="reservedField06"
          label="单位"
          width="130"
        >
        </el-table-column>
        <el-table-column align="center" prop="sl" label="销售数量" width="130">
        </el-table-column>
        <el-table-column align="center" prop="jhr" label="拣货人" width="160">
        </el-table-column>
        <el-table-column
          align="center"
          prop="jhsj"
          label="拣货时间"
          width="160"
        >
        </el-table-column>
        <el-table-column align="center" prop="sl1" label="复核数量">
        </el-table-column>
        <el-table-column align="center" prop="fhr" label="复核人">
        </el-table-column>
        <el-table-column
          align="center"
          prop="fhsj"
          label="复核时间"
          width="160"
        >
        </el-table-column>
        <el-table-column align="center" prop="wfhr" label="外复核人">
        </el-table-column>
        <el-table-column
          align="center"
          prop="wfsj"
          label="外复核时间"
          width="160"
        >
        </el-table-column>
        <el-table-column align="center" prop="dj" label="单价">
        </el-table-column>
        <el-table-column align="center" prop="je" label="金额">
        </el-table-column>
        <el-table-column
          align="center"
          prop="pzwh"
          label="批准文号/注册证/备案凭证号"
          width="190"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="reservedField07"
          label="上市许可持有人/医疗器械注册人、备案人"
          width="210"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="lotatt01"
          label="生产日期"
          width="120"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="lotatt02"
          label="有效期至/使用期限/失效日期"
          width="130"
        >
        </el-table-column>
        <el-table-column align="center" prop="freightDescr1" label="货物类型" width="120">
        </el-table-column>
      </el-table>
      <!-- <div>
        <pagination
          v-show="total > 0"
          :total="total"
          :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize"
          @pagination="handleQuery"
        />
      </div> -->
    </div>
  </div>
</template>

<script>
import { listOutbound } from "@/api/system/conserve";
export default {
  dicts: ["floor_type", "taskprocess_type", "taskprocessmsg_type"],
  data() {
    return {
      // 总条数
      total: 0,
      //   addTime: [
      //     new Date().toISOString().split("T")[0],
      //     new Date().toISOString().split("T")[0],
      //   ],
      queryParams: {
        // pageNum: 1,
        // pageSize: 20,
        fmcustomerId:"",
        issuepartyId: "",
        lotatt04: "",
        sku: "",
        docNo: "",
      },
      tableData: [],
      loading: false,
      redateRange: [],
    };
  },
  mounted() {
    // this.handleQuery();
  },
  methods: {
    goBack() {
      this.$router.push("/subSystem1");
    },
    handleQuery() {
      this.$refs.queryForm.validate((valid) => {
        if (valid) {
          this.queryParams.params = {};
          if (null != this.redateRange && "" != this.redateRange) {
            this.queryParams.params["beginTime"] = this.redateRange[0];
            this.queryParams.params["endTime"] = this.redateRange[1];
          }
          this.loading = true;
          listOutbound(this.queryParams).then((res) => {
            this.tableData = res.data;
            this.total = res.total;
            this.loading = false;
          });
          //   if (
          //     this.queryParams.params["beginTime"] &&
          //     this.queryParams.params["endTime"]
          //   ) {
          //     this.loading = true;
          //     listOutbound(this.queryParams).then((res) => {
          //       this.tableData = res.data;
          //       this.total = res.total;
          //       this.loading = false;
          //     });
          //   } else {
          //     this.loading = false;
          //     this.$message.error("请选择查询时间");
          //   }
        }
      });
    },
    resetQuery() {
      this.resetForm("queryForm");
      this.redateRange = [];
    },
    handleExport() {
      this.download(
        "system/lzBb/export",
        {
          ...this.queryParams,
        },
        `post_${new Date().getTime()}.xlsx`
      );
    },
  },
};
</script>
<style lang="scss" scoped>
.app-container {
  .el-icon-data-analysis::before {
    color: #00d9ff;
    margin-right: 8px;
  }
  .title1 {
    font-size: 16px;
    // margin-bottom: 15px;
    color: #808080;
    width: 170px;
    padding: 5px;
    border-bottom: 1px dotted #8ddfff;
  }
  .header {
    margin-top: -10px;
    margin-bottom: 20px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;

    .el-date-editor.el-input,
    .el-date-editor.el-input__inner {
      width: 220px;
      margin-right: 20px;
    }

    .backB {
      cursor: pointer;

      img {
        width: 20%;
      }
    }
  }
  .formCenter {
    min-height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    .btn {
      margin-left: 130px;
    }
    ::v-deep .el-input--suffix .el-input__inner {
      width: 240px;
    }
  }
  .footer {
    margin-top: 20px;
    width: 100%;
    min-height: 200px;
  }
  .el-select {
    width: 240px;
  }
  // 表格有滚动条使暂无数据居中
  ::v-deep .el-table__empty-block {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
  }
  //   滚动条宽度
  ::v-deep .el-table__body-wrapper::-webkit-scrollbar {
    width: 10px; // 横向滚动条
    height: 10px; // 纵向滚动条 必写
  }
}
</style>